@echo off
echo Starting FastMCP Server and Client...

:: 检查Python是否安装
python --version >nul 2>&1
if errorlevel 1 (
    echo Python is not installed or not in PATH
    pause
    exit /b 1
)

:: 检查是否安装了必要的包
echo Checking dependencies...
pip install --user -r requirements.txt

:: 启动服务器（在新窗口中）
start "FastMCP Server" cmd /c "python fast_mcp_server.py"

:: 等待服务器启动
echo Waiting for server to start...
timeout /t 5 /nobreak

:: 启动客户端
echo Starting MCP Client...
python mcp_demo.py

:: 如果客户端退出，关闭服务器
taskkill /FI "WINDOWTITLE eq FastMCP Server" /F
echo FastMCP Server and Client stopped.
pause 